<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use kartik\grid\GridView;

/* @var $this yii\web\View */
/* @var $model common\models\DictionaryType */

$this->title = $model->name;
$this->params['breadcrumbs'][] = ['label' => '字典', 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="dictionary-type-view panel panel-body">

    <div class="row">
        <div class="col-sm-9">
        </div>
        <div  style="margin: 15px 20px;float: right;">

            <?= Html::a('编辑', ['update', 'id' => $model->code], ['class' => 'btn btn-primary']) ?>
            <?= Html::a('删除', ['delete', 'id' => $model->code], [
                'class' => 'btn btn-danger',
                'data' => [
                    'confirm' => '您确定要执行删除操作么？',
                    'method' => 'post',
                ],
            ])
            ?>
            <?= Html::a('返回列表', ['index'], ['class' => 'btn btn-info']) ?>
        </div>
    </div>

    <div class="row">
<?php
    $gridColumn = [
        'code',
        'name',
        'order_num',
        'customizable',
    ];
    echo DetailView::widget([
        'model' => $model,
        'attributes' => $gridColumn
    ]);
?>
    </div>

    <div class="row">
<?php
if($providerDictionary->totalCount){
    $gridColumnDictionary = [
        ['class' => 'yii\grid\SerialColumn'],
                        'value',
            'label',
            'mnemonic',
            'parent_id',
            'level',
    ];
    echo Gridview::widget([
        'dataProvider' => $providerDictionary,
        'pjax' => true,
        'pjaxSettings' => ['options' => ['id' => 'kv-pjax-container-dictionary']],
        'panel' => [
            'type' => GridView::TYPE_PRIMARY,
            'heading' => '<span class="glyphicon glyphicon-book"></span> ' . Html::encode('字典'),
        ],
        'export' => false,
        'columns' => $gridColumnDictionary
    ]);
}
?>

    </div>
</div>
